<div class="sect3">
<h4 id="stages"><a class="anchor" href="#stages"></a>stages<a class="anchorjs-link " href="#stages" aria-label="Anchor link for: stages" data-anchorjs-icon="" style="font: 1em/1 anchorjs-icons; padding-left: 0.375em;"></a></h4>
<div class="paragraph">
<p>Containing a sequence of one or more <a href="#stage">stage</a> directives, the <code>stages</code> section is where
the bulk of the "work" described by a Pipeline will be located. At a minimum it
is recommended that <code>stages</code> contain at least one <a href="#stage">stage</a> directive for each
discrete part of the continuous delivery process, such as Build, Test, and
Deploy.</p>
</div>
<table class="tableblock frame-all grid-all stretch syntax">
<colgroup>
<col style="width: 10%;">
<col style="width: 90%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-center valign-top"><p class="tableblock">Required</p></th>
<td class="tableblock halign-right valign-top"><div class="content"><div class="paragraph">
<p>Yes</p>
</div></div></td>
</tr>
<tr>
<th class="tableblock halign-center valign-top"><p class="tableblock">Parameters</p></th>
<td class="tableblock halign-right valign-top"><div class="content"><div class="paragraph">
<p><em>None</em></p>
</div></div></td>
</tr>
<tr>
<th class="tableblock halign-center valign-top"><p class="tableblock">Allowed</p></th>
<td class="tableblock halign-right valign-top"><div class="content"><div class="paragraph">
<p>Only once, inside the <code>pipeline</code> block.</p>
</div></div></td>
</tr>
</tbody>
</table>
<div class="sect4">
<h5 id="stages-example"><a class="anchor" href="#stages-example"></a>Example<a class="anchorjs-link " href="#stages-example" aria-label="Anchor link for: stages example" data-anchorjs-icon="" style="font: 1em/1 anchorjs-icons; padding-left: 0.375em;"></a></h5>
<div class="pipeline-block">  <div class="listingblock pipeline-declarative">
    <div class="title">Jenkinsfile (Declarative Pipeline)</div>
    <div class="content">
  <pre class="CodeRay highlight nowrap"><code class="language-groovy" data-lang="groovy">pipeline {
    agent any
    stages { <span style="color:#777"><i class="conum" data-value="1"></i><b>(1)</b></span>
        stage(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Example</span><span style="color:#710">'</span></span>) {
            steps {
                echo <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">Hello World</span><span style="color:#710">'</span></span>
            }
        }
    }
}</code></pre>
</div></div></div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The <code>stages</code> section will typically follow the directives such as <code>agent</code>,
<code>options</code>, etc.</td>
</tr>
</tbody></table>
</div>
</div>
</div>